package com.indusfo.spc.controller;

import com.indusfo.spc.pojo.Order;
import com.indusfo.spc.pojo.Station;
import com.indusfo.spc.pojo.Statistical;
import com.indusfo.spc.service.StatisticalService;
import com.indusfo.spc.service.WorkshopService;
import com.indusfo.spc.vo.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @Author: 熊冰  首页  统计
 * @Date: 2020/3/23 14:23
 */
@Controller
@RequestMapping("/service/statistical")
public class StatisticalController {

	@Resource
	private StatisticalService statisticalService;


	/**
	 * @Author 熊冰  近七天完成数量
	 * @Date 2020/3/24 15:07
	 */
	@RequestMapping(value = "/querySevenFinishNum")
	@ResponseBody
	public JSONObject querySevenFinishNum(Statistical statistical) {
		JSONObject json = statisticalService.querySevenFinishNum(statistical);
		return json;

	}

	/**
	 * @Author 熊冰  近七天不良数量
	 * @Date 2020/3/24 15:07
	 */
	@RequestMapping(value = "/querySevenBadNum")
	@ResponseBody
	public JSONObject querySevenBadNum(Statistical statistical) {
		JSONObject json = statisticalService.querySevenBadNum(statistical);
		return json;

	}

	/**
	 * @Author 熊冰  近一年的 任务单良率
	 * @Date 2020/3/24 15:08
	 */
	@RequestMapping(value = "/queryYearOrderRate")
	@ResponseBody
	public JSONObject queryYearOrderRate(Statistical statistical) {
		JSONObject json = statisticalService.queryYearOrderRate(statistical);
		return json;

	}



	/**
	 * @Author 熊冰   本周任务单进度
	 * @Date 2020/3/24 15:08
	 */
	@RequestMapping(value = "/queryOrderFinishRate")
	@ResponseBody
	public JSONObject queryOrderFinishRate(Order order) {
		JSONObject json = statisticalService.queryOrderFinishRate(order);
		return json;

	}


	/**
	 * @Author 熊冰  完成产品数量
	 * @Date 2020/3/24 15:13
	 */
	@RequestMapping(value = "/queryCountFinishBatch")
	@ResponseBody
	public JSONObject queryCountFinishBatch(Statistical statistical) {
		JSONObject json = statisticalService.queryCountFinishBatch(statistical);
		return json;
	}

	/**
	 * @Author 熊冰   完成任务单数量
	 * @Date 2020/3/24 15:13
	 */
	@RequestMapping(value = "/queryCountFinishOrder")
	@ResponseBody
	public JSONObject queryCountFinishOrder(Statistical statistical) {
		JSONObject json = statisticalService.queryCountFinishOrder(statistical);
		return json;
	}

	/**
	 * @Author 熊冰  车间
	 * @Date 2020/3/24 16:02
	 */
	@RequestMapping(value = "/queryWorkshopFinish")
	@ResponseBody
	public JSONObject queryWorkshopFinish(Statistical statistical) {
		JSONObject json = statisticalService.queryWorkshopFinish(statistical);
		return json;
	}

	/**
	 * @Author 熊冰   完成任务单和任务单数量
	 * @Date 2020/3/24 15:13
	 */
	@RequestMapping(value = "/queryCountFinishBatchAndOrder")
	@ResponseBody
	public JSONObject queryCountFinishBatchAndOrder(Statistical statistical) {
		JSONObject json = statisticalService.queryCountFinishBatchAndOrder(statistical);
		return json;
	}




}
